package com.lhkj.ct.meta.modules.patient.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lhkj.ct.meta.modules.patient.model.entity.TblPatCardRelation;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
  * <p>
  *     描述：用户绑定就诊卡 服务类
  * </p>
  */
@Validated
public interface PatCardRelationService extends IService<TblPatCardRelation> {

    /**
     * 查询用户绑定的就诊卡号
     */
    List<TblPatCardRelation> selectByUser();

    /**
     * 创建默认就诊卡
     * @param patCardRelation
     * @return
     */
    boolean createDefaultCard(@NotNull @Valid TblPatCardRelation patCardRelation);

    /**
     * 绑定就诊卡
     * @param isIgnoreException 如果已绑定该就诊卡号，是否忽略异常
     */
    boolean bindPatCard(@NotNull @Valid TblPatCardRelation patCardRelation, boolean isIgnoreException);
}
